/**
 * Copyright &copy; 2012-2016 civet All rights reserved.
 */
package cn.mcsys.myadmin.modules.goods.entity;

import cn.mcsys.myadmin.common.persistence.TreeEntity;
import cn.mcsys.myadmin.common.persistence.TreeEntity;
import com.google.common.collect.Lists;
import org.hibernate.validator.constraints.Length;

import cn.mcsys.myadmin.common.persistence.DataEntity;

import java.util.List;

/**
 * 商品分类Entity
 * @author Jockey
 * @version 2016-11-20
 */
public class GoodsCategory extends TreeEntity<GoodsCategory> {
	
	private static final long serialVersionUID = 1L;

	private String categoryName;		// 类别名称
	private String categoryCode;		// 类别编码

	private String remarks;

	private List<GoodsCategory> childList = Lists.newArrayList(); 	// 拥有子分类列表
	public GoodsCategory() {
		super();
	}

	public GoodsCategory(Integer id){
		super(id);
	}

	public GoodsCategory getParent() {
		return parent;
	}
	public void setParent(GoodsCategory parent) {
		this.parent = parent;
	}
	
	@Length(min=1, max=50, message="类别名称长度必须介于 1 和 50 之间")
	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	
	@Length(min=0, max=50, message="类别编码长度必须介于 0 和 50 之间")
	public String getCategoryCode() {
		return categoryCode;
	}
	public void setCategoryCode(String categoryCode) {
		this.categoryCode = categoryCode;
	}


	@Override
	public String getRemarks() {
		return remarks;
	}
	@Override
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public List<GoodsCategory> getChildList() {
		return childList;
	}
	public void setChildList(List<GoodsCategory> childList) {
		this.childList = childList;
	}
}